<?php

class Admin_Form_LocationRent extends Zend_Form
{

    public function init(){
    	
        $this->setMethod('post');
        
        $this->addElement('text','txtLocation',array(
        			'label'		=>	'Khu vực - mặc bằng cho thuê',
        			'required'	=>	TRUE,
        			'class'		=> 'required'
        		));
        $this->addElement('select','cbbBlank',array(
        			'label'			=>	'Trạng thái của mặc bằng thuê',
        			'required'		=>	TRUE,
        			'class'			=> 'required',
        			'multiOptions'	=> array(
        								'0'	=>	'Còn trống',
        								'1'	=> 	'Đã cho thuê'	
        							)
        		));
        
    }
    
	/**
     * 
     * Set action cho form
     * @param unknown_type $actionName: ten cua action
     */
    function addAction($module,$controller, $actionName){
    	$this->setAction(Zend_Controller_Front::getInstance()->getBaseUrl()."/".$module."/".$controller."/".$actionName);
    }
    
    /**
     * 
     * Add nut submit 
     */
    function addSubmitButton($name, $label){
    	$this->addElement('submit',$name,array(
    						'label'		=>	$label,
    						'decorators'=>	array('ViewHelper',array('HtmlTag',array(
    																			'tag' => 'dd' //giu nguyen the dd ko them bat cu the j
    																		)
    														
    															)
    							
    										),
    						'class'		=>	'input-hover uSubmit'	
    					));
    	
    }
    
    function addHiddenId($name,$value){
    	$this->addElement('hidden',$name,array(
			    				'value'	=> $value	
    						));
    }
    

	private function getAllMenu1(){
    	$menu1 = new Admin_Model_Menu1s();
    	$menu1 = $menu1->fetchAllMenu1();
    	$arrData = array();
    	foreach ($menu1 as $value) {
    		$arrData[$value['menu1Id']] =$value['tenMenu1']	;
    	}
    	return $arrData;
    }


}

